<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!doctype html>
<html lang="en">

<head>
<title>流程启动表单</title>
<!-- bootstrap -->
<link type="text/css" rel="stylesheet" href="${ctx}/static/styles/bootstrap/css/bootstrap.min.css">

<link href="${ctx}/static/xform/styles/layout3.css" rel="stylesheet">
<link href="${ctx}/static/xform/styles/xform.css" rel="stylesheet">
<script type="text/javascript" src="${ctx}/static/xform/designer-xform-all.js"></script>
<script type="text/javascript" src="${ctx}/static/xform/container-layout.js"></script>
<script type="text/javascript" src="${ctx}/static/xform/adaptor.js"></script>
<script type="text/javascript">
document.onmousedown = function(e) {};
document.onmousemove = function(e) {};
document.onmouseup = function(e) {};
document.ondblclick = function(e) {};

$(function() {
	$(document).delegate('#button0', 'click', function(e) {
		$('#xf-form').attr('action', '${ctx}/bpm/confForm/form-saveDraft.do');
		$('#xf-form').submit();
	});

	$(document).delegate('#button1', 'click', function(e) {
		$('#xf-form').attr('action', '${ctx}/bpm/confForm/form-${nextStep}.do');
		$('#xf-form').submit();
	});

	setTimeout(function() {
		xform.setValue(${json});
		var id = '#xf-form-table-body-row' + (xform.model.template.positions.length - 1);
		var el = $(id)[0];
		el.parentNode.removeChild(el);
	}, 1000);
});
    </script>
</head>
<body>
	<div class="row-fluid">
		<!-- start of main -->
		<section id="m-main" class="span10" style="float:right">
	  <div id="__gef_container__" style="padding-left:5px;">
		<div id="__gef_canvas__" style="float:left;clear:right;overflow:auto;">
		  <div id="xf-center" class="xf-center" unselectable="on">
			<div id="xf-layer-form" class="xf-layer-form">
			  <form id="xf-form" method="post" action="${ctx}/form/form-startProcessInstance.do" class="xf-form">
				<input id="processDefinitionId" type="hidden" name="processDefinitionId" value="${formInfo.processDefinitionId}">
				<input id="bpmProcessId" type="hidden" name="bpmProcessId" value="${bpmProcessId}">
				<input id="autoCompleteFirstTask" type="hidden" name="autoCompleteFirstTask" value="${formInfo.autoCompleteFirstTask}">
				<input id="businessKey" type="hidden" name="businessKey" value="${businessKey}">
				<!--
				<input id="taskId" type="hidden" name="taskId" value="${taskId}">
				-->
				<table id="xf-form-table" class="xf-form-table">
				  <thead id="xf-form-table-head"><tr><th>Title</th></tr></thead>
				  <tbody id="xf-form-table-body"><tr><td>Body</td></tr></tbody>
				  <tfoot id="xf-form-table-foot"><tr><td>Footer</td></tr></tfoot>
				</table>
			  </form>
			</div>
		  </div>
		</div>
	  </div>

    </section>
		<!-- end of main -->

		<form id="f" action="form-template-save.do" method="post" style="display: none;">
			<textarea id="__gef_content__" name="content">${formTemplate.content}</textarea>
		</form>
	</div>
</body>

</html>
